package jmine.tec.hydra.dao;

import java.util.List;

import jmine.tec.hydra.api.HydraSpecification;
import jmine.tec.hydra.domain.actions.DefaultEncodeMessageAction;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import bancosys.tec.persist.dao.BaseDAO;

/**
 * DAO de {@link DefaultEncodeMessageAction}.
 * 
 * @author Renan Kuroki
 * @created May 16, 2011
 */
public class DefaultEncodeMessageActionDAO extends BaseDAO<DefaultEncodeMessageAction> {

    /**
     * Retorna uma lista de {@link DefaultEncodeMessageAction}, de acordo com a {@link HydraSpecification} passada como parametro.
     * 
     * @param specification especificação a qual a conversa segue.
     * @return lista de conversations.
     */
    public List<DefaultEncodeMessageAction> findBySpecification(HydraSpecification specification) {
        Criteria crit = this.createCriteria();
        crit.add(Restrictions.eq("specification", specification));
        return this.executeQuery(crit);
    }
}
